import Flutter
import UIKit

public class SwiftFlutterBdfacePlugin: NSObject, FlutterPlugin {
  public static func register(with registrar: FlutterPluginRegistrar) {
    let channel = FlutterMethodChannel(name: "flutter_bdface_plugin", binaryMessenger: registrar.messenger())
    let instance = SwiftFlutterBdfacePlugin()
    registrar.addMethodCallDelegate(instance, channel: channel)
  }

  public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
    switch call.method {
        case "getPlatformVersion":
            result(UIDevice.current.systemVersion)
        case "detect":
            detect(result:result);
            break
        case "liveness":
            liveness(result:result);
            break
    default:result(FlutterError(code: "no method", message: "no method", details: nil))
    }}
    
    func detect(result: @escaping FlutterResult) {
        print("detect");
        var bdc = BDFaceDetectionViewController();
    }
    func liveness(result: @escaping FlutterResult) {
        print("liveness");
    }
}
